import React, { createContext, useState } from 'react';
import Child1 from './Child1';
export const nameContext = createContext();

export default function UseContext () {
    const [count, setCount] = useState({ count: 1 });
    return (
        <div>
            {
                <nameContext.Provider value={count}>
                    <Child1 onClick={(val) => setCount({ count: val + 1 })} />
                </nameContext.Provider>
            }
        </div>
    );
}
